<!DOCTYPE html>
<html>
  <head>
    <meta charset="utf-8">
    <meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1">
    <title>校园Packer</title>
    <link rel="stylesheet" href="/css/lib/bootstrap.min.css">
    <link rel="stylesheet" href="/css/app.css">
    
  </head>
  <body>
    <header>
      <div class="clearfix">
        <div class="headerTitle">我校食堂后台管理系统</div><a class="btn btn-warning pull-right logout">注销</a><span class="pull-right headerText">欢迎您，<span id="role"></span><span id="name"></span></span>
      </div>
    </header>
    <div class="sidebar">
      <ul>
        <li class="toggleUl"><a>权限管理</a>
          <ul>
            <li class="subItem"><a href="/views/manager.html">查看管理员</a></li>
            <li class="subItem"><a href="/views/master.html">查看堂主</a></li>
            <li class="subItem"><a href="/views/courier.html">查看配送员</a></li>
          </ul>
        </li>
        <li class="toggleUl"><a>学校管理</a>
          <ul>
            <li class="subItem"><a href="/views/school_manage.html">学校管理</a></li>
            <li class="subItem"><a href="/views/canteen_manage.html">食堂管理</a></li>
          </ul>
        </li>
        <li class="toggleUl"><a>商品管理</a>
          <ul>
            <li class="subItem"><a href="/views/goods_manage.html">商品管理</a></li>
            <li class="subItem"><a href="/views/import_goods.html">导入商品</a></li>
          </ul>
        </li>
        <li class="toggleUl"><a>文件管理</a>
        </li>
        <li class="toggleUl"><a>财务管理</a>
        </li>
        <li class="toggleUl"><a>交易管理</a>
          <ul>
            <li class="subItem"><a href="/views/trade_manage.html">查看交易</a></li>
            <li class="subItem"><a href="/views/import_trade.html">导入交易</a></li>
          </ul>
        </li>
        <li class="toggleUl"><a href="/views/delivery_manage.html">发货管理</a>
        </li>
        <li class="toggleUl"><a href="/views/user_query.html">用户查询</a>
        </li>
        <li class="toggleUl"><a href="/views/trade_query.html">交易查询</a>
        </li>
        <li class="toggleUl"><a href="/views/goods_query.html">商品查询</a>
        </li>
        <li class="toggleUl"><a href="/views/order_query.html">订单查询</a>
        </li>
      </ul>
    </div>
    <title>校园Packer</title>
    <div class="rightSide">
      <div class="container-fluid">
        <div class="row">
          <div class="col-sm-10 col-sm-offset-1">
            <div class="row managerOnly">
              <label>选择你要操作的学校</label>
              <select id="schoolSelect"></select><a class="btn btn-primary pull-right goodsQuery">查询</a>
            </div>
            <div class="row">
              <label>选择要添加食品到哪个食堂</label>
              <select id="shopSelect"></select>
            </div>
            <hr>
            <div class="row text-center">
              <div class="underLine col-sm-6 active"><a href="#tab1" class="mutedLink">1.选择你要导入的商品</a></div>
              <div class="underLine col-sm-6"><a href="#tab2" class="mutedLink">2.确认你要导入的商品</a></div>
            </div>
            <div id="tab1" class="row tab">
              <div class="row">
                <table id="selectTable" class="table table-hovered table-bordered"></table>
              </div>
              <div class="row"><a class="btn btn-primary addAll">添加该页所有商品到待导入列表</a></div>
              <div class="row text-right forcedVerticalCenter">
                <div id="paginator1" class="paginator"></div><span class="marginLeft marginRight">共<span id="total"></span>条记录</span>
              </div>
            </div>
            <div id="tab2" class="row tab">
              <div class="row">
                <table id="selectedTable" class="table table-hovered table-bordered">		</table>
              </div>
              <div class="row"><a class="btn btn-danger removeAll">清空待导入列表</a></div>
              <div class="row text-right forcedVerticalCenter">
                <div id="paginator2" class="paginator"></div><span class="marginLeft marginRight">共<span id="total2"></span>条记录</span>
              </div>
              <div class="row text-center"><a class="btn btn-success import">确认导入</a></div>
            </div>
          </div>
        </div>
      </div>
    </div>
    <script type="text/x-dot-template" id="schoolTmpl">{{~it:school}}
      <option value="{{=school.id}}">{{=school.name}}</option>{{~}}
    </script>
    <script type="text/x-dot-template" id="shopTmpl">{{~it:shop}}
      <option value="{{=shop.id}}">{{=shop.name}}</option>{{~}}
    </script>
    <script type="text/x-dot-template" id="selectTableTmpl">
      <thead>
        <th>商品</th>
        <th>名称</th>
        <th>价格</th>
        <th>操作</th>
      </thead>
      <tbody>{{~it:goods}}
        <tr>
          <td><img src="{{=goods.item_main_img}}" class="previewImg"></td>
          <td>{{=goods.item_name}}</td>
          <td>{{=goods.item_price}}</td>
          <td> <a data-id="{{=goods.num_iid}}" class="btn btn-success addToImport">添加到待导入列表</a></td>
        </tr>{{~}}
      </tbody>
    </script>
    <script type="text/x-dot-template" id="selectedTableTmpl">
      <thead>
        <th>商品</th>
        <th>名称</th>
        <th>价格</th>
        <th>操作</th>
      </thead>
      <tbody>{{~it:goods}}
        <tr>
          <td><img src="{{=goods.item_main_img}}" class="previewImg"></td>
          <td>{{=goods.item_name}}</td>
          <td>{{=goods.item_price}}</td>
          <td> <a data-id="{{=goods.num_iid}}" class="btn btn-danger removeToImport">从待导入列表移除</a></td>
        </tr>{{~}}
      </tbody>
    </script>
    <link rel="stylesheet" href="/css/lib/select2.min.css">
    <script src="/js/lib/require.js" data-main="/js/import_goods"></script>
    <div id="noticeModal" class="modal fade">
      <div class="modal-dialog">
        <div class="modal-content">
          <div class="modal-body">
            <h4 id="noticeMsg"></h4>
          </div>
          <div class="modal-footer">
            <button type="button" data-dismiss="modal" class="btn btn-primary">确定</button>
          </div>
        </div>
      </div>
    </div>
    <div id="confirmModal" class="modal fade">
      <div class="modal-dialog">
        <div class="modal-content">
          <div class="modal-body">
            <h4 id="confirmMsg"></h4>
          </div>
          <div class="modal-footer">
            <button type="button" id="confirmBtn" class="btn btn-primary">确认</button>
            <button type="button" data-dismiss="modal" class="btn btn-default">取消</button>
          </div>
        </div>
      </div>
    </div>
    <div id="sendModal" aria-hidden="true" data-backdrop="data-backdrop" class="modal fade">
      <div class="modal-dialog">
        <div class="modal-content">
          <div class="modal-body">
            <h4 id="sendMsg"></h4>
          </div>
          <div class="modal-footer">
            <button type="button" id="sendConfirm" class="btn btn-primary">确认</button>
            <button id="cancelOrder" type="button" data-dismiss="modal" class="btn btn-default">取消</button>
          </div>
        </div>
      </div>
    </div>
    <script src="/js/index.js"></script>
  </body>
</html>